import { defineConfig } from "vitepress";
import AutoImport from 'unplugin-auto-import/vite'
import Components from 'unplugin-vue-components/vite'
import { NaiveUiResolver } from 'unplugin-vue-components/resolvers'
import AutoNav from "vite-plugin-vitepress-auto-nav";
export default defineConfig({
  title: "梦想编织屋",
  description: "A Dream Builder.",
  lang: "zh-cmn-Hans",
  base: "/blog/",
  // 忽略解析部分md文件（默认忽略node_modules），仅打包后生效，被忽略的文件不影响被其他文件导入
  srcExclude: [
    "**/(README).md",
    "(.vitepress|public|images|.guthub|components|snippets)/**/*.md",
  ],
  head: [["link", { rel: "icon", href: "/blog/favicon.ico" }]],
  lastUpdated: true,
  markdown: {
    lineNumbers: true,
    defaultHighlightLang: "js",
  },
  vite: {
    base: "/blog/",
    plugins: [
      AutoNav(),
      // vue(),
      AutoImport({
        imports: [
          "vue",
          {
            "naive-ui": [
              "useDialog",
              "useMessage",
              "useNotification",
              "useLoadingBar",
            ],
          },
        ],
      }),
      Components({
        resolvers: [NaiveUiResolver()],
      }),
    ],
  },
  themeConfig: {
    editLink: {
      pattern: "https://gitee.com/crushMinis/blog/edit/main/:path",
      text: "在Gitee上编辑此页",
    },
    nav: [
      {
        text: "笔记",
        link: "/笔记/论文阅读/基于多模型融合的船舶能耗预测方法研究_王建行",
        activeMatch: "/笔记/",
      },
      {
        text: "项目",
        link: "/项目/微信公众号爬虫",
        activeMatch: "/项目/",
      },
      {
        text: "关于",
        link: "/about-me",
      },
    ],

    logo: {
      light: "/light.svg",
      dark: "/dark.svg",
    },
    outline: "deep",
    outlineTitle: "目录",
    socialLinks: [{ icon: "github", link: "https://github.com/crush0" }],
    docFooter: {
      prev: "上一篇",
      next: "下一篇",
    },
    darkModeSwitchTitle: "切换暗色主题",
    lightModeSwitchTitle: "切换亮色主题",
    darkModeSwitchLabel: "切换主题",
    sidebarMenuLabel: "菜单",
    returnToTopLabel: "回到顶部",
    langMenuLabel: "切换语言",
    lastUpdated: {
      text: "更新时间",
    },
    externalLinkIcon: true,
    search: {
      provider: "local",
      options: {
        translations: {
          button: {
            buttonText: "搜索文档",
          },
          modal: {
            displayDetails: "显示详情",
            noResultsText: "未找到相关结果",
            resetButtonTitle: "清除",
            footer: {
              closeText: "关闭",
              selectText: "选择",
              navigateText: "切换",
            },
          },
        },
      },
    },
  },
});
